package bam;

import java.io.Serializable;

public  abstract class Account implements Serializable{
       private int id;
       private int temp=100000;
       private String password;
       private String name;
       private String personId;
       private String email;
       private double balance;


    public Account() {

   }

    public Account(final int id, final String password, final String name, final String personId, final String email, final double balance) {
        this.id =++temp;
        this.password = password;
        this.name = name;
        this.personId = personId;
        this.email = email;
        this.balance = balance;
    }

    public double getBalance(){
        return this.balance;
    }

    public String getEmail() {
        return email;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getPassword() {
        return password;
    }

    public String getPersonId() {
        return personId;
    }

    public void setBalance(final double balance) {
        this.balance = balance;
    }

    public void setEmail(final String email) {
        this.email = email;
    }

    public void setId(final int id) {
        this.id = id;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public void setPassword(final String password) {
        this.password = password;
    }

    public void setPersonId(final String personId) {
        this.personId = personId;
    }

   public abstract void withdraw(double a) throws Exception;

   public abstract boolean equals(Account obj);


   public final void deposit (final double a){
       this.balance+=a;

   }

}